<?php use \Inationsoft\NS; use \Inationsoft\NS\UI\Widget; ?> 
<form method="post" action="<?php echo $app_base_url; ?>/index">
<div class="breadcrumbwidget">
	<ul class="breadcrumb">
		<li><a href="http://localhost/~inanta/simtur">Beranda</a> <span class="divider">/</span></li>
		<li class="active"><?php echo _('Application'); ?></h1><span><?php _('Application'); ?></li>
	</ul>
</div><!--breadcrumbs-->
<div class="pagetitle">
	<div class="row-fluid">
		<div class="span6"><h1><?php echo _('Application'); ?></h1><span><?php echo _('Application'); ?></span></div>
	</div>
</div><!--pagetitle-->

<div class="maincontent">
	<div class="contentinner">
		<div class="form-wrapper">
			<table class="data-list table">
				<thead>
					<tr>
						<th><?php echo _('Application Name'); ?></th>
						<th><?php echo _('Is Installed'); ?></th>
						<th><?php echo _('Is Enabled'); ?></th>
						<th class="align-center"><?php echo _('Action'); ?></th>
					<tr>
				</thead>
				<tbody>
					<?php $counter = 0; ?>
					<?php foreach($datas as $data): ?>
					<?php if($counter % 2 == 0): ?>
					<tr class="alternate-row">
					<?php else: ?>
					<tr>
					<?php endif; ?>
						<td><?php echo $data['Name']; ?></td>
						<td><?php echo _(isset($data['Installed']) ? 'Yes' : 'No'); ?></td>
						<td><?php echo _(isset($data['Installed']) && !empty($data['Installed']['is_enabled']) ? 'Yes' : 'No'); ?></td>
						<td class="align-center action-button">
							<?php if($data['Name'] != 'System'): ?>
								<?php if(isset($data['Installed'])): ?>
									<?php echo new Widget\Bootstrap\DropdownButton('actions', array(
										'<span class="icon-remove"></span> ' . _('Uninstall') => $app_base_url . '/uninstall/' . $data['Path'] . '/' . $data['Installed']['application_id'] . '/' . $data['Installed']['install_token'],
										empty($data['Installed']['is_enabled']) ? '<span class="icon-ok-sign"></span> ' . _('Enable') : '<span class="icon-remove-sign"></span> ' . _('Disable') => empty($data['Installed']['is_enabled']) ? $app_base_url . '/status/' . $data['Installed']['application_id'] . '/1' : $app_base_url . '/status/' . $data['Installed']['application_id'] . '/0',
									), true);
									?>
								<?php else: ?>
								<?php echo new Widget\Bootstrap\HyperlinkButton('actions', $app_base_url . '/install/' . $data['Path'], '<span class="icon-download"></span> ' . _('Install')); ?>
								<?php endif; ?>
								
							<?php else: ?>
							-
							<?php endif;?>
						</td>
					</tr>
					<?php ++$counter; ?>
					<?php endforeach; ?> 
				</tbody>
				<tfoot>
					<tr class="table-pos">
						<td colspan="4">
							<?php echo ($data_count == 0 ? _('Application not found') : sprintf(_('Showing 1 to %s of %s applications'), $data_count, $data_count)); ?> 
						</td>
					</tr>
				</tfoot>
			</table>
		</div>
	</div><!--contentinner-->
</div><!--maincontent-->
</form>